import request from '@/utils/request'


// 请求登录token的返回值类型
export interface loginTokenType {
    token:string
}

// 请求用户数据的返回值类型
export interface userInfoType {
    routes: string[];
    buttons: string[];
    roles: string[];
    name: string;
    avatar: string;

}


// 请求登录
export const reqLogin = (username:string,password:string) => {
    return request.post<null,loginTokenType>(`/admin/acl/index/login`, {username,password})
}

// 请求用户信息
export const reqGetUserInfo = () => {
    return request.get<null,userInfoType>(`/admin/acl/index/info`)
}

// 请求退出登录
export const reqLogout = () => {
    return request.post( `/admin/acl/index/logout`)
}